//index.js
//获取应用实例

var {a}=require('../../models/http');
var http=require('../../models/http');
Page({
  data: {
    msg: "hellow",
    test: "测试",
    arr: ["html", "js", "css"],
    isFocus: false,
    isPlay: false,
    test: true,
  },
  handleConfirm(event) {
    console.log(event.detail)
  },
  handleSubmit(event) {
    console.log(event.detail.value)
  },
  handleClick() {
    console.log(1)
    this.setData({
      msg: "change"
    })
  },
  onLoad() {
    //wx-request
    console.log(a)
    console.log(http.a)
    var reqTask=wx.request({
      url:'http://192.168.14.49:3000/search?keywords=%E4%BD%A0',
      header:{'content-type':'application/json'},
      method:'GET',
      dataType:'json',
      success:(result)=>{
        console.log(result)
      }
    })
    console.log("加载")
  },
  onReady() {
    console.log("readt")
  },
  onShow() {
    console.log("show")
  },
  handleMusic() {
    this.setData({
      isPlay: !this.data.isPlay
      
    })
 
  }
})
